# Maintainer: Daurnimator <daurnimator@archlinux.org>

pkgname=('lua-argparse' 'lua51-argparse' 'lua52-argparse' 'lua53-argparse')
pkgver=0.7.1
pkgrel=1
arch=('any')
url='https://github.com/luarocks/argparse'
license=('MIT')
source=("$pkgname-$pkgver.tar.gz::https://github.com/luarocks/argparse/archive/$pkgver.tar.gz")
sha512sums=('f192d0c591516a74408a19c0bbf34233be180f63794211a951d19fc8d981749bc71eace16a4680c8f2bb302ab48958c6a9ffc84022a1754275fc1f9113ae32b0')

package_lua-argparse() {
	pkgdesc='Feature-rich command line parser for Lua 5.4'

	cd "argparse-$pkgver"
	install -Dm644 src/argparse.lua "$pkgdir/usr/share/lua/5.4/argparse.lua"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua51-argparse() {
	pkgdesc='Feature-rich command line parser for Lua 5.1'

	cd "argparse-$pkgver"
	install -Dm644 src/argparse.lua "$pkgdir/usr/share/lua/5.1/argparse.lua"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua52-argparse() {
	pkgdesc='Feature-rich command line parser for Lua 5.2'

	cd "argparse-$pkgver"
	install -Dm644 src/argparse.lua "$pkgdir/usr/share/lua/5.2/argparse.lua"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua53-argparse() {
	pkgdesc='Feature-rich command line parser for Lua 5.3'

	cd "argparse-$pkgver"
	install -Dm644 src/argparse.lua "$pkgdir/usr/share/lua/5.3/argparse.lua"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
